<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">

<head>
  <th:block th:include="include :: header('修改智能AI模型校验信息')" />
  <th:block th:include="include :: datetimepicker-css" />
</head>

<body class="white-bg">
  <div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-checkService-edit" th:object="${aiIdentifyModelCheckT}">
      <input name="checkId" th:field="*{checkId}" type="hidden">
      <div class="form-group">
        <label class="col-sm-3 control-label">模型名称：</label>
        <div class="col-sm-8">
          <input id="1" th:field="*{modelName}" class="form-control" type="text" list="modelName">
          <datalist id="modelName">
            <option value="人和安全帽">人和安全帽</option>
            <option value="人员装备">人员装备</option>
            <option value="主煤流检测">主煤流检测</option>
            <option value="人和车检测">人和车检测</option>
            <option value="煤流量">煤流量</option>
          </datalist>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">模型类别：</label>
        <div class="col-sm-8">
          <input id="2" th:field="*{modelKind}" class="form-control" type="text" list="modelKind">
          <datalist id="modelKind">
            <option value="目标检测">目标检测</option>
            <option value="图像分类">图像分类</option>
          </datalist>
        </div>
      </div>

      <!--            <div class="form-group">-->
      <!--                <label class="col-sm-3 control-label">模型ID：</label>-->
      <!--                <div class="col-sm-8">-->
      <!--                    <input name="modelId" th:field="*{modelId}" class="form-control" type="text">-->
      <!--                </div>-->
      <!--            </div>-->
      <div class="form-group">
        <label class="col-sm-3 control-label">版本号：</label>
        <div class="col-sm-8">
          <input name="version" th:field="*{version}" class="form-control" type="text">
        </div>
      </div>
      <!--            <div class="form-group">-->
      <!--                <label class="col-sm-3 control-label">校验前图片、视频路径：</label>-->
      <!--                <div class="col-sm-8">-->
      <!--                    <input name="checkResourcePath" th:field="*{checkResourcePath}" class="form-control" type="text">-->
      <!--                </div>-->
      <!--            </div>-->
      <!--            <div class="form-group">-->
      <!--                <label class="col-sm-3 control-label">校验后图片、视频路径：</label>-->
      <!--                <div class="col-sm-8">-->
      <!--                    <input name="checkedResourcePath" th:field="*{checkedResourcePath}" class="form-control" type="text">-->
      <!--                </div>-->
      <!--            </div>-->
      <div class="form-group">
        <label class="col-sm-3 control-label is-required">检测时间：</label>
        <div class="col-sm-8">
          <div class="input-group date">
            <input name="returnTime" th:value="${#dates.format(aiIdentifyModelCheckT.returnTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">原图：</label>
                <div class="col-sm-8">
                  <img   id="image" alt="Login" width="200"   th:src="*{checkResourcePath}"/>
                </div>
                <label class="col-sm-3 control-label is-required">识别结果：</label>
                <div class="col-sm-8">
                  <img   id="image" alt="Login" width="200"   th:src="*{checkedResourcePath}"/>
                </div>
              
              </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />


    <script th:inline="javascript">

      console.log("拿到对象{}",aiIdentifyModelCheckT)


        var prefix = ctx + "AI/checkService";
        $("#form-checkService-edit").validate({
            focusCleanup: true
        });


        function submitHandler() {
            if ($.validate.form()) {
              console.log("地址=》{}",prefix + "/edit")
                $.operate.save("http://localhost/AI/checkService/edit", $('#form-checkService-edit').serialize());
            }
        }

        $("input[name='returnTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>